<?php


/*
* Copyright (c) 2008-2016 vip.com, All Rights Reserved.
*
* Powered by com.vip.osp.osp-idlc-2.5.11.
*
*/

namespace com\vip\svip\osp\service;

class UserUseBeforePayContractRecordModel {
	
	static $_TSPEC;
	public $contractSn = null;
	public $wxOrderSn = null;
	public $platform = null;
	public $status = null;
	public $totalQuota = null;
	public $openTime = null;
	public $closeTime = null;
	public $remark = null;
	
	public function __construct($vals=null){
		
		if (!isset(self::$_TSPEC)){
			
			self::$_TSPEC = array(
			1 => array(
			'var' => 'contractSn'
			),
			2 => array(
			'var' => 'wxOrderSn'
			),
			3 => array(
			'var' => 'platform'
			),
			4 => array(
			'var' => 'status'
			),
			5 => array(
			'var' => 'totalQuota'
			),
			6 => array(
			'var' => 'openTime'
			),
			7 => array(
			'var' => 'closeTime'
			),
			8 => array(
			'var' => 'remark'
			),
			
			);
			
		}
		
		if (is_array($vals)){
			
			
			if (isset($vals['contractSn'])){
				
				$this->contractSn = $vals['contractSn'];
			}
			
			
			if (isset($vals['wxOrderSn'])){
				
				$this->wxOrderSn = $vals['wxOrderSn'];
			}
			
			
			if (isset($vals['platform'])){
				
				$this->platform = $vals['platform'];
			}
			
			
			if (isset($vals['status'])){
				
				$this->status = $vals['status'];
			}
			
			
			if (isset($vals['totalQuota'])){
				
				$this->totalQuota = $vals['totalQuota'];
			}
			
			
			if (isset($vals['openTime'])){
				
				$this->openTime = $vals['openTime'];
			}
			
			
			if (isset($vals['closeTime'])){
				
				$this->closeTime = $vals['closeTime'];
			}
			
			
			if (isset($vals['remark'])){
				
				$this->remark = $vals['remark'];
			}
			
			
		}
		
	}
	
	
	public function getName(){
		
		return 'UserUseBeforePayContractRecordModel';
	}
	
	public function read($input){
		
		$input->readStructBegin();
		while(true){
			
			$schemeField = $input->readFieldBegin();
			if ($schemeField == null) break;
			$needSkip = true;
			
			
			if ("contractSn" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->contractSn);
				
			}
			
			
			
			
			if ("wxOrderSn" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->wxOrderSn);
				
			}
			
			
			
			
			if ("platform" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->platform);
				
			}
			
			
			
			
			if ("status" == $schemeField){
				
				$needSkip = false;
				$input->readI32($this->status); 
				
			}
			
			
			
			
			if ("totalQuota" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->totalQuota);
				
			}
			
			
			
			
			if ("openTime" == $schemeField){
				
				$needSkip = false;
				$input->readI64($this->openTime);
				
			}
			
			
			
			
			if ("closeTime" == $schemeField){
				
				$needSkip = false;
				$input->readI64($this->closeTime);
				
			}
			
			
			
			
			if ("remark" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->remark);
				
			}
			
			
			
			if($needSkip){
				
				\Osp\Protocol\ProtocolUtil::skip($input);
			}
			
			$input->readFieldEnd();
		}
		
		$input->readStructEnd();
		
		
		
	}
	
	public function write($output){
		
		$xfer = 0;
		$xfer += $output->writeStructBegin();
		
		if($this->contractSn !== null) {
			
			$xfer += $output->writeFieldBegin('contractSn');
			$xfer += $output->writeString($this->contractSn);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->wxOrderSn !== null) {
			
			$xfer += $output->writeFieldBegin('wxOrderSn');
			$xfer += $output->writeString($this->wxOrderSn);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->platform !== null) {
			
			$xfer += $output->writeFieldBegin('platform');
			$xfer += $output->writeString($this->platform);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->status !== null) {
			
			$xfer += $output->writeFieldBegin('status');
			$xfer += $output->writeI32($this->status);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->totalQuota !== null) {
			
			$xfer += $output->writeFieldBegin('totalQuota');
			$xfer += $output->writeString($this->totalQuota);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->openTime !== null) {
			
			$xfer += $output->writeFieldBegin('openTime');
			$xfer += $output->writeI64($this->openTime);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->closeTime !== null) {
			
			$xfer += $output->writeFieldBegin('closeTime');
			$xfer += $output->writeI64($this->closeTime);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->remark !== null) {
			
			$xfer += $output->writeFieldBegin('remark');
			$xfer += $output->writeString($this->remark);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		$xfer += $output->writeFieldStop();
		$xfer += $output->writeStructEnd();
		return $xfer;
	}
	
}

?>